package com.zimin.cloud.user.controller;

import com.zimin.cloud.user.biz.IUserRoleBiz;
import com.zimin.cloud.user.common.util.ServletUtil;
import com.zimin.shared.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import com.zimin.shared.pojo.BaseController;
import com.zimin.cloud.user.controller.api.IUserRoleController;

/**
 * <p>
 * 用户角色关联表 前端控制器
 * </p>
 *
 * @author zimin
 * @since 2022-06-14 16:10
 */
@RestController
public class UserRoleController extends BaseController implements IUserRoleController {

    @Autowired
    public IUserRoleBiz userRoleBiz;

    @Override
    public Result getUserAuthorities() {
        var userId = ServletUtil.getCurrentUserId();
        return result(userRoleBiz.getUserAuthorities(userId));
    }
}
